package com.homeorder.action;

import java.util.List;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.homeorder.entity.BandInfo;
import com.homeorder.service.BandService;
import com.opensymphony.xwork2.Action;

public class BandAction {
	private List<BandInfo> blist;
	private BandService bandService;

	public BandAction() {
		BeanFactory bf = new ClassPathXmlApplicationContext("applicationContext.xml");
		bandService = (BandService) bf.getBean("bandService");
	}

	public List<BandInfo> getBlist() {
		return blist;
	}

	public void setBlist(List<BandInfo> blist) {
		this.blist = blist;
	}

	public String get() throws Exception {
		blist = bandService.getBand();
		return Action.SUCCESS;
	}
}
